﻿
namespace Test30.Engine
{
    public class GainHealthAction : Action
    {
        public GainHealthAction(Entity entity, Attack amount)
            : base(entity)
        {
            _amount = amount;
        }

        protected override ActionResult OnProcess()
        {
            int amount = _amount.Roll();

            Entity.Health.AddBonus(BonusType.Permanent, amount);
            Entity.Health.Current += amount;

            return ActionResult.Done;
        }

        private readonly Attack _amount;
    }
}
